<%@page import="util.TextFormat"%>
<%@page contentType="text/html;charset=utf-8" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.ArrayList"%>

<%
	List<Map<String, Object>> categoryList = (List<Map<String, Object>>)request.getAttribute("categoryList");
	if(categoryList == null){
		categoryList = new ArrayList<Map<String, Object>>();
	}
%>
<div class="book_l_border1" id="__FenLeiLiuLan">
	<div class="book_sort_tushu">
		<h2>
			分类浏览
		</h2>
		
		
		<%
			for(int i = 0; i < categoryList.size(); i++){
				Map<String, Object> category = categoryList.get(i);
		%>
				<!--1级分类开始-->
				<div class="bg_old" onmouseover="this.className = 'bg_white';"
					onmouseout="this.className = 'bg_old';">
					<h3>
						[<a href='javascript:;'><%=TextFormat.getText(category, "name")%></a>]
					</h3>
					<ul class="ul_left_list">
			<%
				List<Map<String, Object>> subCategoryList = (List<Map<String, Object>>)category.get("subCategoryList");	
				for(int j = 0; subCategoryList != null && j < subCategoryList.size(); j++){
					Map<String, Object> subCategory = subCategoryList.get(j);
			%>
					<!--2级分类开始-->
					<li>
						<a href='<%=request.getContextPath()%>/main/bookList.do?parent_id=<%=TextFormat.getText(category, "id")%>&sub_id=<%=TextFormat.getText(subCategory, "id")%>'>
							<%=TextFormat.getText(subCategory, "name")%>
						</a>
					</li>
					<!--2级分类结束-->
			<%
				}
			%>
					</ul>
					<div class="empty_left">
					</div>
				</div>
				<!--1级分类结束-->
		<%
			}
		%>
		
		<div class="bg_old">
			<h3>
				&nbsp;
			</h3>
		</div>
	</div>
</div>
